public class Test {
    public static void main(String[] args) {
//        Dog dog = new Dog();
//        dog.shout();
//        Cat cat = new Cat();
//        cat.shout();
        //dog
        Animal pet = new Dog();
        pet.shout();
        //cat
        pet = new Cat();
        pet.shout();
        //调用鸭子
        pet = new Duck();
        pet.shout();
        Swim duck = new Duck();
        duck.swim();

    }

}
